﻿using Modules.FaceScan;
using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;
using static Modules.CheckIn.CheckInDetailConstants;

namespace Modules.FaceScan.Entitys
{
    /// <summary>
    /// 人脸识别记录
    ///</summary>
    [TableName("face_scan_record")]
    [Description("人脸识别记录表")]
    [PrimaryKey("id", AutoIncrement = true)]
    [CacheSetting(true)]
    [Serializable]
    public class FaceScanRecord : IEntity
    {
        /// <summary>
        ///
        ///</summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 扫描代码
        /// </summary>
        [Column("scan_code")]
        public string ScanCode { get; set; }
        /// <summary>
        /// 扫描来源类型
        ///</summary>
        [Column("refer_type")]
        public FaceScanReferType ReferType { get; set; }

        /// <summary>
        /// 人脸认证身份证号码
        ///</summary>
        [Column("id_card")]
        public string IdCard { get; set; }

        /// <summary>
        /// 是否已确认
        ///</summary>
        [Column("is_confirmed")]
        public bool IsConfirmed { get; set; }

        /// <summary>
        /// 确认时间
        ///</summary>
        [Column("confirm_time")]
        public DateTime? ConfirmTime { get; set; }

        /// <summary>
        /// 相似性
        ///</summary>
        [Column("similarity")]
        public decimal? Similarity { get; set; }

        /// <summary>
        /// 已通过识别
        ///</summary>
        [Column("is_passed")]
        public bool IsPassed { get; set; }

        /// <summary>
        /// 验证时间
        ///</summary>
        [Column("verify_time")]
        public DateTime? VerifyTime { get; set; }

        /// <summary>
        /// 头像图片地址
        ///</summary>
        [Column("camera_photo")]
        public string CameraPhoto { get; set; }

        /// <summary>
        ///
        ///</summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        ///  数据来源
        ///</summary>
        [Column("data_source")]
        public 数据来源 DataSource { get; set; }

        /// <summary>
        /// 活体动作
        /// </summary>
        [Ignore]
        public int[] Actions { get; set; } = new int[0];

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return Id; } }

        #endregion IEntity 成员
    }
}